package com.zjm.servlet.servlet10_safe;

import javax.servlet.ServletException;
import javax.servlet.SingleThreadModel;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author ZJM
 * @date 2024/4/19 22:44
 * 实现SingleThreadModel接口解决线程安全，但是效率低
 */
@WebServlet("/safe2")
public class Safe02Servlet extends HttpServlet implements SingleThreadModel {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        super.doGet(req, resp);
    }
}
